home *** CD-ROM | disk | FTP | other *** search
/ Delphi 2 - Developers' Solutions / Delphi 2 Developers' Solutions.iso / dds / chap09 / howto01 / delphi10 / cciccfrm.~pa < prev    next >
Encoding:
Text File  |  1996-06-11  |  20.1 KB  |  589 lines

  1. unit Cciccfrm;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, ExtCtrls, StdCtrls, Buttons, Menus, FileCtrl,
  8.   {Winsock,} CCWSock, CCICCInf, CCICCPrf, IniFiles, Gauges;
  9.  
  10. type
  11.   { This record holds the information for a number of internet connections }
  12.   PConnectionsRecord = ^TConnectionsRecord;
  13.   TConnectionsRecord = record
  14.     CProfile   : string; { Connection profile; used in lists }
  15.     CIPAddress : string; { Dotted character IP Address       }
  16.     CUserName  : string; { Login name to site; can be anonym }
  17.     CPassword  : string; { Password; won't be shown          }
  18.     CStartDir  : string; { Starting directory; used for FTP  }
  19.   end;
  20.   { Array of TCR }
  21.   CRFile = file of TConnectionsRecord; { File type for TCRec }
  22.   TCCINetCCForm = class(TForm)
  23.     Panel1: TPanel;
  24.     Panel2: TPanel;
  25.     Panel3: TPanel;
  26.     Panel4: TPanel;
  27.     Panel5: TPanel;
  28.     Panel6: TPanel;
  29.     ListBox1: TListBox;
  30.     Panel7: TPanel;
  31.     SpeedButton1: TSpeedButton;
  32.     SpeedButton2: TSpeedButton;
  33.     ListBox2: TListBox;
  34.     ComboBox1: TComboBox;
  35.     Button1: TButton;
  36.     Memo1: TMemo;
  37.     SpeedButton4: TSpeedButton;
  38.     SpeedButton5: TSpeedButton;
  39.     SpeedButton3: TSpeedButton;
  40.     Panel8: TPanel;
  41.     Label1: TLabel;
  42.     Label2: TLabel;
  43.     ComboBox2: TComboBox;
  44.     Label3: TLabel;
  45.     ComboBox3: TComboBox;
  46.     Label4: TLabel;
  47.     Label5: TLabel;
  48.     OpenDialog1: TOpenDialog;
  49.     SaveDialog1: TSaveDialog;
  50.     PrintDialog1: TPrintDialog;
  51.     PrinterSetupDialog1: TPrinterSetupDialog;
  52.     FindDialog1: TFindDialog;
  53.     ReplaceDialog1: TReplaceDialog;
  54.     Gauge1: TGauge;
  55.     MainMenu1: TMainMenu;
  56.     Network1: TMenuItem;
  57.     ViewWinsockInfo1: TMenuItem;
  58.     Description1: TMenuItem;
  59.     SystemStatus1: TMenuItem;
  60.     VendorSpecific1: TMenuItem;
  61.     N1: TMenuItem;
  62.     ProgressInfo1: TMenuItem;
  63.     ViewInEditWindow1: TMenuItem;
  64.     ViewInStatusLine1: TMenuItem;
  65.     SaveToFile1: TMenuItem;
  66.     N2: TMenuItem;
  67.     Exit1: TMenuItem;
  68.     Services1: TMenuItem;
  69.     IPAddress1: TMenuItem;
  70.     EMail1: TMenuItem;
  71.     FTP1: TMenuItem;
  72.     UsenetNws1: TMenuItem;
  73.     Files1: TMenuItem;
  74.     Load1: TMenuItem;
  75.     Save1: TMenuItem;
  76.     Encoding1: TMenuItem;
  77.     UUDecode1: TMenuItem;
  78.     MIMEDecode1: TMenuItem;
  79.     UUEncode1: TMenuItem;
  80.     MIMEEncode1: TMenuItem;
  81.     Edit1: TMenuItem;
  82.     Cut1: TMenuItem;
  83.     Copy1: TMenuItem;
  84.     CopytoFile1: TMenuItem;
  85.     Paste1: TMenuItem;
  86.     PastefromFile1: TMenuItem;
  87.     EMail2: TMenuItem;
  88.     CheckMail1: TMenuItem;
  89.     CreateNewMessage1: TMenuItem;
  90.     ReplyToCurrentMessage1: TMenuItem;
  91.     SendCurrentMessage1: TMenuItem;
  92.     SendQueue1: TMenuItem;
  93.     MailServers1: TMenuItem;
  94.     Mailboxes1: TMenuItem;
  95.     Correspondents1: TMenuItem;
  96.     TrashMarkedMessages1: TMenuItem;
  97.     EmptyTrash1: TMenuItem;
  98.     ExitEMailRequired1: TMenuItem;
  99.     FTP2: TMenuItem;
  100.     ConnectToSite1: TMenuItem;
  101.     Disconnect1: TMenuItem;
  102.     UploadMarked1: TMenuItem;
  103.     ASCII1: TMenuItem;
  104.     Binary1: TMenuItem;
  105.     DownloadMarked1: TMenuItem;
  106.     ASCII2: TMenuItem;
  107.     ToFile1: TMenuItem;
  108.     ToDisplay1: TMenuItem;
  109.     Binary2: TMenuItem;
  110.     Directory1: TMenuItem;
  111.     ViewRemoteasText1: TMenuItem;
  112.     ViewasText1: TMenuItem;
  113.     Change1: TMenuItem;
  114.     Create1: TMenuItem;
  115.     Delete3: TMenuItem;
  116.     ChangeLocal1: TMenuItem;
  117.     DeleteRemoteFiles1: TMenuItem;
  118.     FTPSites1: TMenuItem;
  119.     News1: TMenuItem;
  120.     ConnectandUpdate1: TMenuItem;
  121.     Disconnect2: TMenuItem;
  122.     Headers1: TMenuItem;
  123.     RetrieveMarked1: TMenuItem;
  124.     RetrieveAll1: TMenuItem;
  125.     CheckNewNews1: TMenuItem;
  126.     GetMarked1: TMenuItem;
  127.     Article1: TMenuItem;
  128.     NewArticle1: TMenuItem;
  129.     FollowupArticle1: TMenuItem;
  130.     PutinQueue1: TMenuItem;
  131.     Post1: TMenuItem;
  132.     CurrentArticle1: TMenuItem;
  133.     EntireQueue1: TMenuItem;
  134.     NewsServers1: TMenuItem;
  135.     SubscribedNewsgroups1: TMenuItem;
  136.     Trash1: TMenuItem;
  137.     AllReadArticles1: TMenuItem;
  138.     AllMarkedArticles1: TMenuItem;
  139.     AllAvailableArticles1: TMenuItem;
  140.     DownloadActiveNewsgroups1: TMenuItem;
  141.     Preferences1: TMenuItem;
  142.     EMail3: TMenuItem;
  143.     FTP3: TMenuItem;
  144.     News2: TMenuItem;
  145.     Paths1: TMenuItem;
  146.     procedure Exit1Click(Sender: TObject);
  147.     procedure FormCreate(Sender: TObject);
  148.     procedure FormDestroy(Sender: TObject);
  149.     procedure Description1Click(Sender: TObject);
  150.     procedure SystemStatus1Click(Sender: TObject);
  151.     procedure VendorSpecific1Click(Sender: TObject);
  152.     procedure ViewInEditWindow1Click(Sender: TObject);
  153.     procedure ViewInStatusLine1Click(Sender: TObject);
  154.     procedure SaveToFile1Click(Sender: TObject);
  155.     procedure FormResize(Sender: TObject);
  156.   private
  157.     { Private declarations }
  158.   public
  159.     { Public declarations }
  160.     procedure ReadIniData;
  161.     procedure WriteIniData;
  162.     procedure AddNullTermTextToMemo( TheTextToAdd   : string;
  163.                                      TheMemoToAddTo : TMemo   );
  164.     function AddNullTermTextToLabel( TheTextToAdd   : string ) : string;
  165.     procedure AddProgressText( WhatText : string );
  166.     procedure ShowProgressText( WhatText : string );
  167.     procedure ShowProgressErrorText( WhatText : string );
  168.     procedure SocketsErrorOccurred( Sender     : TObject;
  169.                                      ErrorCode  : Integer;
  170.                                      TheMessage : string   );
  171.   end;
  172.  
  173. const
  174.   POV_MEMO                 = 1; { Progress to the Memo           }
  175.   POV_STAT                 = 2; { Progress to the status caption }
  176.   FTP_STATUS_PRELIMINARY   = 1; { Wait; command being processed  }
  177.   FTP_STATUS_COMPLETED     = 2; { Done; command fully succeded   }
  178.   FTP_STATUS_CONTINUING    = 3; { OK; send more data to finish   }
  179.   FTP_STATUS_RETRY_COMMAND = 4; { Temporary Error; try cmd again }
  180.   FTP_STATUS_FATAL_ERROR   = 5; { Fatal Error; don't retry cmd   }
  181.  
  182. var
  183.   CCINetCCForm         : TCCINetCCForm;
  184.   GlobalErrorCode      : Integer;        { Used to pass around error info  }
  185.   GlobalAbortedFlag    : Boolean;        { Used to signal timeout error    }
  186.   ProgressList         : TStringList;    { Used to hold progress text info }
  187.   ProgressFileName     : string;         { Used to hold progress file name }
  188.   ProgressOutputVector : Integer;        { Used to direct progress output  }
  189.   TheFTPSiteList       : TList;          { Used to store the FTP site recs }
  190.   TheWorkingFTPSL      : TList;          { Used to store working copy of l }
  191.   TheFTPSiteFile       : CRFile;         { Used to load the FTP site file  }
  192.   TheICCIniFile        : TIniFile;       { Used to retrieve the INI File   }
  193.   MailPath             : string;         { Used for path to Mail Files     }
  194.   NewsPath             : string;         { Used for path to News Files     }
  195.   WWWPath              : string;         { Used for path to WWW Files      }
  196.   FTPPath              : string;         { Used for path to FTP Files      }
  197.   CurrentPassWordString : string;        { Used to hold login id for anons }
  198.   PassWordControlVector : Integer;       { Used to hold display of pw vect }
  199.   CurrentRealPWString   : string;        { Used to hold a real password    }
  200.   TheLine ,
  201.   HolderLine ,
  202.   GlobalTextBuffer      : string;
  203.   TheAnonRedialVector ,
  204.   DefaultDownloadVector : Integer;
  205.   LeftoverText          : string;
  206.   LeftoversOnTable      : Boolean;
  207.   FileNameToXFer        : string;
  208.  
  209. implementation
  210.  
  211. {$R *.DFM}
  212.  
  213.  
  214.  
  215. { This procedure reads in the ini file and default path info }
  216. procedure TCCINetCCForm.ReadIniData;
  217. begin
  218.   TheICCIniFile := TIniFile.Create( 'CCICC.INI' );
  219.   MailPath := TheICCIniFile.ReadString( 'Paths','MailPath','C:\WINDOWS' );
  220.   NewsPath := TheICCIniFile.ReadString( 'Paths','NewsPath','C:\WINDOWS' );
  221.   WWWPath := TheICCIniFile.ReadString( 'Paths','WWWPath','C:\WINDOWS' );
  222.   FTPPath := TheICCIniFile.ReadString( 'Paths','FTPPath','C:\WINDOWS' );
  223.   PasswordControlVector := TheICCIniFile.ReadInteger( 'Vectors','PWControl',2 );
  224.   DefaultDownloadVector := TheICCIniFile.ReadInteger( 'Vectors','DefDL', 3 );
  225.   TheAnonRedialVector := TheICCIniFile.ReadInteger( 'Vectors','AnonRD', 20 );
  226.   TheICCIniFile.Free;
  227. end;
  228.  
  229. { This procedure writes out default path data to the ini file }
  230. procedure TCCINetCCForm.WriteIniData;
  231. begin
  232.   TheICCIniFile := TIniFile.Create( 'CCICC.INI' );
  233.   TheICCIniFile.WriteString( 'Paths','MailPath',MailPath );
  234.   TheICCIniFile.WriteString( 'Paths','NewsPath',NewsPath );
  235.   TheICCIniFile.WriteString( 'Paths','WWWPath',WWWPath );
  236.   TheICCIniFile.WriteString( 'Paths','FTPPath',FTPPath );
  237.   TheICCIniFile.WriteInteger( 'Vectors','PWControl',PasswordControlVector );
  238.   TheICCIniFile.WriteInteger( 'Vectors','DefDL',DefaultDownloadVector );
  239.   TheICCIniFile.WriteInteger( 'Vectors','AnonRD', TheAnonRedialVector );
  240.   TheICCIniFile.Free;
  241. end;
  242.  
  243. { This procedure scans a line of UNIX-style text for #10's and }
  244. { outputs them as lines to the memo. It stops at #0.           }
  245. procedure TCCINetCCForm.AddNullTermTextToMemo( TheTextToAdd   : string;
  246.                                  TheMemoToAddTo : TMemo   );
  247. var
  248.   TextLength ,            { Total chars to output         }
  249.   Counter_1    : Integer; { Loop Index                    }
  250. begin
  251.   { Make the target memo visible just in case }
  252.   TheMemoToAddTo.Visible := true;
  253.   { Find total chars to output }
  254.   TextLength := Length( TheTextToAdd );
  255.   { If none then leave }
  256.   if TextLength = 0 then exit;
  257.   { Loop along the string }
  258.   for Counter_1 := 1 to TextLength do
  259.   begin
  260.     { If hit ASCII 10 then assume end of line and output }
  261.     if TheTextToAdd[ Counter_1 ] = #10 then
  262.     begin
  263.       { Use a try loop incase memo fills up }
  264.       try
  265.         { Add the line }
  266.         TheMemoToAddTo.Lines.Add( TheLine );
  267.       except
  268.         { If memo fills up }
  269.         on EOutOfResources do
  270.         begin
  271.           { Clear the old data }
  272.           TheMemoToAddTo.Clear;
  273.           { Output the new }
  274.           TheMemoToAddTo.Lines.Add( TheLine );
  275.         end;
  276.       end;
  277.       { clear the output buffer }
  278.       TheLine := '';
  279.     end
  280.     else
  281.     { Otherwise look for null terminator from Winsock }
  282.     begin
  283.       { If don't hit null terminator then add the char to op buffer }
  284.       if TheTextToAdd[ Counter_1 ] <> #0 then
  285.       begin
  286.         TheLine := TheLine + TheTextToAdd[ Counter_1 ];
  287.       end
  288.       else
  289.       begin
  290.         if TheLine <> '' then
  291.         begin
  292.           { Use a try loop incase memo fills up }
  293.           try
  294.             { Add the line }
  295.             TheMemoToAddTo.Lines.Add( TheLine );
  296.           except
  297.             { If memo fills up }
  298.             on EOutOfResources do
  299.             begin
  300.               { Clear the old data }
  301.               TheMemoToAddTo.Clear;
  302.               { Output the new }
  303.               TheMemoToAddTo.Lines.Add( TheLine );
  304.             end;
  305.           end;
  306.           { clear the output buffer }
  307.           TheLine := '';
  308.         end;
  309.       end;
  310.     end;
  311.   end;
  312. end;
  313.  
  314. { This function scans a line of UNIX-style text for #10's and }
  315. { outputs the first line as its return value,stopping at #0.  }
  316. function TCCINetCCForm.AddNullTermTextToLabel( TheTextToAdd   : string ) : string;
  317. var
  318.   TheLine      : string;  { Buffer to output current line }
  319.   TextLength ,            { Total chars to output         }
  320.   Counter_1    : Integer; { Loop Index                    }
  321. begin
  322.   { Clear output buffer }
  323.   TheLine := '';
  324.   { Find total chars to output }
  325.   TextLength := Length( TheTextToAdd );
  326.   { If none then leave }
  327.   if TextLength = 0 then
  328.   begin
  329.     { Return nothing }
  330.     Result := '';
  331.     { Leave }
  332.     exit;
  333.   end;
  334.   { Loop along the string }
  335.   for Counter_1 := 1 to TextLength do
  336.   begin
  337.     { If hit ASCII 10 then assume end of line and output }
  338.     if TheTextToAdd[ Counter_1 ] = #10 then
  339.     begin
  340.       { Return first line }
  341.       Result := TheLine;
  342.       { Leave }
  343.       exit;
  344.     end
  345.     else
  346.     { Otherwise look for null terminator from Winsock }
  347.     begin
  348.       { If don't hit null terminator then add the char to op buffer }
  349.       if TheTextToAdd[ Counter_1 ] <> #0 then
  350.       begin
  351.         TheLine := TheLine + TheTextToAdd[ Counter_1 ];
  352.       end
  353.       else break; { Otherwise drop out of the loop }
  354.     end;
  355.   end;
  356.   { If hit #0 before #10 return buffer }
  357.   Result := TheLine;
  358. end;
  359.  
  360. { Exit method }
  361. procedure TCCINetCCForm.Exit1Click(Sender: TObject);
  362. begin
  363.   Close;
  364. end;
  365.  
  366. { This method adds a line to the progress text stringlist  }
  367. { If an exception occurs, the list is full, and it is auto }
  368. { saved to the progress text file name, then cleared.      }
  369. procedure TCCINetCCForm.AddProgressText( WhatText : string );
  370. begin
  371.   { Use a try..except loop to catch list overflows }
  372.   try
  373.     { Try the normal add }
  374.     ProgressList.Add( WhatText );
  375.   except
  376.     { Any list error is assumed to be a list overflow }
  377.     on EListError do
  378.     begin
  379.       { Save the list to the preset file name }
  380.       ProgressList.SaveToFile( ProgressFileName );
  381.       { Clear the list to make more room }
  382.       ProgressList.Clear;
  383.       { And redo the add; any further errors will except normally }
  384.       ProgressList.Add( WhatText );
  385.     end;
  386.     { This might happen too! }
  387.     on EOutOfResources do
  388.     begin
  389.       { Save the list to the preset file name }
  390.       ProgressList.SaveToFile( ProgressFileName );
  391.       { Clear the list to make more room }
  392.       ProgressList.Clear;
  393.       { And redo the add; any further errors will except normally }
  394.       ProgressList.Add( WhatText );
  395.     end;
  396.   end;
  397. end;
  398.  
  399. { This method either adds the progress line to the current memo }
  400. { or puts it in the status caption at normal colors.            }
  401. procedure TCCINetCCForm.ShowProgressText( WhatText : string );
  402. begin
  403.   { Use the POV to determine where to show progress info }
  404.   case ProgressOutputVector of
  405.     POV_MEMO : begin { Output into the memo  }
  406.                  AddNullTermTextToMemo( WhatText , Memo1 );
  407.                end;
  408.     POV_STAT : begin { Output on status line }
  409.                  { Set panel caption font to black }
  410.                  Panel1.Font.Color := clBlack;
  411.                  { Get the first line of text and put in caption }
  412.                  Panel1.Caption := AddNullTermTextToLabel( WhatText );
  413.                end;
  414.   end;
  415. end;
  416.  
  417. { This method is identical with SPT except sets status color to red and beeps }
  418. procedure TCCINetCCForm.ShowProgressErrorText( WhatText : string );
  419. begin
  420.   { Do error beep }
  421.   MessageBeep( mb_IconExclamation );
  422.   { Use the POV to determine where to show progress info }
  423.   case ProgressOutputVector of
  424.     POV_MEMO : begin { Output into the memo  }
  425.                  AddNullTermTextToMemo( WhatText , Memo1 );
  426.                end;
  427.     POV_STAT : begin { Output on status line }
  428.                  { Set panel caption font to black }
  429.                  Panel1.Font.Color := clRed;
  430.                  { Get the first line of text and put in caption }
  431.                  Panel1.Caption := AddNullTermTextToLabel( WhatText );
  432.                end;
  433.   end;
  434. end;
  435.  
  436. { This is the boilerplate method used to handle Socket errors gracefully }
  437. procedure TCCINetCCForm.SocketsErrorOccurred( Sender     : TObject;
  438.                                               ErrorCode  : Integer;
  439.                                               TheMessage : string   );
  440. begin
  441.   { Set the global error code flag }
  442.   GlobalErrorCode := ErrorCode;
  443.   { If a timeout error }
  444.   if ErrorCode = WSAETIMEDOUT then
  445.   begin
  446.     { Set the aborted flag }
  447.     GlobalAbortedFlag := True;
  448.     { But clear the error code for graceful handling }
  449.     GlobalErrorCode := 0;
  450.   end
  451.   else
  452.   begin
  453.     { Otherwise set the progress buffer to the error message }
  454.     AddProgressText( TheMessage );
  455.     { And show the progress text as set by option }
  456.     ShowProgressErrorText( TheMessage );
  457.   end;
  458. end;
  459.  
  460. procedure TCCINetCCForm.FormCreate(Sender: TObject);
  461. begin
  462.   { Create the progress string list }
  463.   ProgressList := TStringList.Create;
  464.   { Create the file name for saving the progress list }
  465.   ProgressFileName := ExpandFileName( 'PROGRESS.TXT' );
  466.   { Default progress output to status line }
  467.   ProgressOutputVector := POV_STAT;
  468.   { Set password control stuff }
  469.   PasswordControlVector := 2;
  470.   CurrentPasswordString := 'guest@nowhere.com';
  471.   CurrentRealPWString := 'guest@nowhere.com';
  472.   { Get Ini file Data }
  473.   ReadIniData;
  474. end;
  475.  
  476. procedure TCCINetCCForm.FormDestroy(Sender: TObject);
  477. begin
  478.   { Free the progress text stringlist if assigned }
  479.   if assigned( ProgressList ) then ProgressList.Free;
  480.   { Save off the Ini data }
  481.   WriteIniData;
  482. end;
  483.  
  484. procedure TCCINetCCForm.Description1Click(Sender: TObject);
  485. var
  486.   TempSocket : TCCSocket; { Temporary socket just to get Winsock info }
  487.   TheData    : string;    { Holder for data                           }
  488. begin
  489.   { Create socket; auto calls WSAStartup }
  490.   TempSocket := TCCSocket.Create( Self );
  491.   { Do parent just for kicks; no longer needed }
  492.   TempSocket.Parent := self;
  493.   { Put in error handler }
  494.   TempSocket.OnErrorOccurred := SocketsErrorOccurred;
  495.   TheData := StrPas( TempSocket.Socket_WSA_Data.Description_String );
  496.   { Display the Description string }
  497.   AddProgressText( TheData + #0 );
  498.   { And show the progress text as set by option }
  499.   ShowProgressText( TheData + #0 );
  500.   { Free the socket; auto calls WSACleanup }
  501.   TempSocket.Free;
  502. end;
  503.  
  504. procedure TCCINetCCForm.SystemStatus1Click(Sender: TObject);
  505. var
  506.   TempSocket : TCCSocket; { Temporary socket just to get Winsock info }
  507.   TheData    : string;    { Holder for data                           }
  508. begin
  509.   { Create socket; auto calls WSAStartup }
  510.   TempSocket := TCCSocket.Create( Self );
  511.   { Do parent just for kicks; no longer needed }
  512.   TempSocket.Parent := self;
  513.   { Put in error handler }
  514.   TempSocket.OnErrorOccurred := SocketsErrorOccurred;
  515.   TheData := StrPas( TempSocket.Socket_WSA_Data.System_Status_String );
  516.   { Display the Description string }
  517.   AddProgressText( TheData + #0 );
  518.   { And show the progress text as set by option }
  519.   ShowProgressText( TheData + #0 );
  520.   { Free the socket; auto calls WSACleanup }
  521.   TempSocket.Free;
  522. end;
  523.  
  524. procedure TCCINetCCForm.VendorSpecific1Click(Sender: TObject);
  525. var
  526.   TempSocket : TCCSocket; { Temporary socket just to get Winsock info }
  527.   TheData    : string;    { Holder for data                           }
  528. begin
  529.   { Create socket; auto calls WSAStartup }
  530.   TempSocket := TCCSocket.Create( Self );
  531.   { Do parent just for kicks; no longer needed }
  532.   TempSocket.Parent := self;
  533.   { Put in error handler }
  534.   TempSocket.OnErrorOccurred := SocketsErrorOccurred;
  535.   TheData := StrPas( TempSocket.Socket_WSA_Data.Vendor_Specific_String );
  536.   { Display the Description string }
  537.   AddProgressText( TheData + #0 );
  538.   { And show the progress text as set by option }
  539.   ShowProgressText( TheData + #0 );
  540.   { Free the socket; auto calls WSACleanup }
  541.   TempSocket.Free;
  542. end;
  543.  
  544. { This method sets the progress output vector to the memo }
  545. procedure TCCINetCCForm.ViewInEditWindow1Click(Sender: TObject);
  546. begin
  547.   { Set the vector }
  548.   ProgressOutputVector := POV_MEMO;
  549.   { Keep the menu options consistent }
  550.   ViewInEditWindow1.Checked := true;
  551.   ViewInStatusLine1.Checked := false;
  552. end;
  553.  
  554. { This method sets the progress output vector to the status line }
  555. procedure TCCINetCCForm.ViewInStatusLine1Click(Sender: TObject);
  556. begin
  557.   { Set the vector }
  558.   ProgressOutputVector := POV_STAT;
  559.   { Keep the menus consistent }
  560.   ViewInEditWindow1.Checked := false;
  561.   ViewInStatusLine1.Checked := true;
  562. end;
  563.  
  564. procedure TCCINetCCForm.SaveToFile1Click(Sender: TObject);
  565. begin
  566.   { Set up the dialog parameters }
  567.   OpenDialog1.Filename := ProgressFileName;
  568.   OpenDialog1.Title := 'Select Filename for Progress File';
  569.   OpenDialog1.Filter := 'Text Files|*.txt';
  570.   { If the dialog is not cancelled then save and clear }
  571.   if OpenDialog1.Execute then
  572.   begin
  573.     ProgressFileName := OpenDialog1.FileName;
  574.     ProgressList.SaveToFile( ProgressFileName );
  575.     ProgressList.Clear;
  576.   end;
  577. end;
  578.  
  579. procedure TCCINetCCForm.FormResize(Sender: TObject);
  580. begin
  581.   { Use tag vector to determine what to do }
  582.   case Tag of
  583.     { if FTP , make sure two list boxes are same height }
  584.     2 : Panel6.Height := (( Panel4.Height div 2 ) - 30 );
  585.   end;
  586. end;
  587.  
  588. end.
  589.